package syan.genshen.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import syan.genshen.common.Result;
import syan.genshen.dao.bo.AdminHarderBO;
import syan.genshen.dao.bo.QueryAdminBO;
import syan.genshen.service.AdminService;

/**
 * @author CHENTAIWEN
 * @create 2023/2/17 8:39
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    /**
     * 获取到角色
     *
     * @param queryAdminBO
     * @return {@link AdminHarderBO}
     */
    @PostMapping("/queryAdmin")
    public Result<AdminHarderBO> queryAdmin(@RequestBody QueryAdminBO queryAdminBO) {
        AdminHarderBO adminHarder = adminService.queryAdmin(queryAdminBO);
        return Result.ok(adminHarder);
    }
}
